<?php


namespace App\Http\Requests\Manage\System\Express;


use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class StoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * @return array
     * @author luffyzhao@vip.126.com
     */
    public function rules()
    {
        return [
            'code' => ['required', 'max:5', 'alpha_dash', Rule::unique('express')],
            'name' => ['required', 'max:50'],
            'customs_code' => ['required', 'size:10'],
            'customs_name' => ['required', 'max:200'],
            'phone' => ['required', 'max:50'],
            'insured' => ['required', 'numeric'],
            'contacts' => ['required', 'max:50'],
            'remark' => ['nullable', 'max:1000']
        ];
    }
}